#ifndef TS_H
#define TS_H
typedef struct {
    long packet_start_code_prefix;
    unsigned char stream_id;
    unsigned int PESplen;
    unsigned char PEShlen;
    unsigned char PDflags;
    unsigned long long int pts;
    unsigned long long int dts;
} pes_t;

typedef struct {
    unsigned char sync_byte;
    unsigned char tei;
    unsigned char pusi;
    unsigned char tp;
    int PID;
    unsigned char tsc;
    unsigned char afc;
    unsigned char cc;
    unsigned char kf;
    pes_t pes;
    bool IDR;
    bool SPS;
    bool PPS;
} ts_t;

void ts_parse(unsigned char *buf, ts_t *ts);
#endif
